using System;
using System.Configuration;


namespace Brainsoft.Core.Configuration
{	
	public class Config
	{
        public static string GetApplicationRoot(System.Web.HttpRequest req)
        {
            string theApplicationRoot = "http://" + req.ServerVariables["SERVER_NAME"];
			if (req.ServerVariables["SERVER_PORT"] != null && req.ServerVariables["SERVER_PORT"].Length > 0 && req.Url.Port != 80)
            {
                theApplicationRoot += ":" + req.ServerVariables["SERVER_PORT"];
            }
            theApplicationRoot += req.ServerVariables["URL"];

            theApplicationRoot = theApplicationRoot.Substring(0, theApplicationRoot.LastIndexOf("/") + 1);
            return theApplicationRoot;
        }

        public static DateTime GetServerDateTime()
        {
            return DateTime.Now;
        }
		
	}
}
